/*
 * @Author: your name
 * @Date: 2021-06-08 11:08:49
 * @LastEditTime: 2021-06-16 17:34:18
 * @LastEditors: Please set LastEditors
 * @Description: 解析报文使用
 * @FilePath: \UDP\SERVER_\parse.h
 */

#pragma once
#include <iostream>
using namespace std;
#include <stdio.h>
#include<string>

#include "case.h"
#include "database.h"
#include "log.h"
class Parse
{
private:
    // Database db;
public:
    //格式化并展览接收到的信息
    void parse_Message(char* buf);
    //处理注册事件
    void deal_Register(char* recv_buf,char* send_buf);
    //处理登录事件
    void deal_Login(char* recv_buf,char* send_buf);
    //请求所有商品信息
    void deal_Query_All_Commodity(char* recv_buf,char* send_buf);
    //处理充值事件
    void deal_Recharge(char* recv_buf,char* send_buf);
    //处理修改密码的事件
    void deal_Change_Passwd(char* recv_buf,char* send_buf);
    //处理检索商品事件
    void deal_Search_Commodity(char* recv_buf,char* send_buf);
    //根据identifier检索商品
    void deal_Search_Single_Commodity(char* recv_buf,char* send_buf);
    //处理添加购物车
    void deal_Add_Cart(char* recv_buf,char* send_buf);
    //处理修改购物车
    void deal_Modify_Cart(char* recv_buf,char* send_buf);
    //处理订单提交
    void deal_Create_Order(char* recv_buf,char* send_buf);
    //处理添加商品
    void deal_Add_Commodity(char* recv_buf,char* send_buf);
    //处理修改商品
    void deal_Modify_Commodity(char* recv_buf,char* send_buf);
};